import http from '../utils/http';

/**
 * 获取列表
 */
function getCaFolderTree(){
    return new Promise((resolve, reject) => {
        http("get",'/ca/caFolder/getCaFolderTree').then(res => {
            resolve (res);
        },error => {
            console.log("网络异常~",error);
            reject(error)
        })
    })
}

/**
 * saveCaFolder
 * @param folderObj
 * @returns {Promise<unknown>}
 */
function  save(folderObj){
    return new Promise((resolve, reject) => {
        http("post",'/ca/caFolder/save',folderObj).then(res => {
            resolve (res);
        },error => {
            console.log("网络异常~",error);
            reject(error)
        })
    })
}


/**
 * deleteCaFolder
 * @param folderObj
 * @returns {Promise<unknown>}
 */
function  deleteCaFolder(folderObj){
    return new Promise((resolve, reject) => {
        http("post",'/ca/caFolder/remove',folderObj).then(res => {
            resolve (res);
        },error => {
            console.log("网络异常~",error);
            reject(error)
        })
    })
}



export {getCaFolderTree,save,deleteCaFolder}

